package jwlee.testlog;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class Log4jTester {

	static Logger logger = Logger.getLogger(Log4jTester.class.getName());

	Log4jTester() {
		// 读取使用Java属性文件编写的配置文件
		logger.debug("Read config file.");
		PropertyConfigurator.configure("src/log4j.properties");
	}

	public static void printLog() {
		logger.debug("Log4jTest-->>debug");
		logger.info("Log4jTest-->>info");
		logger.warn("Log4jTest-->>warn");
		logger.error("Log4jTest-->>error");
	}

	public static void main(String[] args) {
		Log4jTester.printLog();
		new Log4jTester();
	}
}